1. Technical Field of the Invention
The present invention relates to a data compressor that performs a compression process on image data of a still image and a data decompressor that performs a decompression process on compressed image data of a still image.
2. Description of the Related Art
One known data compressor, which performs a compression process on a still image according to the Joint Photographic Experts Group (JPEG), uses Discrete Cosine Transform (DCT) which is a type of orthogonal transform. The data compressor divides an image to be compressed into blocks of a predetermined pixel size, performs DCT on pixel values of each block, and performs a quantization process and a variable length coding process on DCT coefficients of each block obtained through DCT to generate compressed image data of the still image. A data decompressor, which performs a decompression process on such compressed image data, extracts a variable length code from compressed image data, performs variable length decoding and inverse quantization processes, and then performs Inverse Discrete Cosine Transform (IDCT) on DCT coefficients of each block obtained through the processes to restore the original still image.
However, the conventional data decompressor described above stores DCT coefficients, which have been subjected to variable length decoding and inverse quantization processes, in a memory, and activates IDCT of each block after waiting until DCT coefficients of all blocks of the still image are stored in the memory. Therefore, for example, when the conventional data decompressor reads compressed image data from an external storage medium having a low read speed and performs variable length decoding and inverse quantization on the read compressed image data, activation of IDCT of each block is delayed, thereby increasing the time required until restoration of the still image is activated.
One known algorithm for compressing a still image according to the Joint Photographic Experts Group (JPEG) uses Discrete Cosine Transform (DCT). The compression algorithm divides an image to be compressed into blocks of a predetermined pixel size, performs DCT on pixel values of each block, and performs a quantization process and a variable length coding process on DCT coefficients of each block obtained through DCT to generate compressed image data of the still image. This compression algorithm can perform data compression with high efficiency. However, since this compression algorithm performs DCT of pixel values of each block, independently of each other, to generate compressed image data, the compression algorithm has a problem in that, when the compressed image data is decompressed to restore the still image, block distortion easily occurs such that gray levels of pixels are discontinuous and look awkward at boundaries of blocks.
Patent Reference 1 (Pamphlet of International Patent Application Publication No. 2006/054667) discloses an image compression/decompression technology for solving this problem. In the technology disclosed in Patent Reference 1, compression and decompression of image data of a still image is performed in the following manner.
a. When image data is compressed, an image is divided into blocks of a predetermined pixel size, DCT is performed on pixel values for each block to generate DCT coefficients, DCT coefficients of a slope cancellation function having a slope identical to that of an envelope line of pixel values at boundaries of the block are obtained, the DCT coefficients of the slope cancellation function are subtracted from the DCT coefficients obtained from the pixel values of the block, and quantization and variable length coding processes are performed on the DCT coefficients, from which the DCT coefficients of the slope cancellation function have been subtracted, to generate compressed image data. Here, the DCT coefficients of the slope cancellation function of each block are calculated with reference to DCT coefficients of pixel values of adjacent blocks at top, bottom, left, and right sides of the block.
b. When compressed image data is decompressed, variable length decoding and inverse quantization processes are performed on the compressed image data to restore DCT coefficients of each block, and DCT coefficients of each block before the slope cancellation function is subtracted from the block are restored with reference to DCT coefficients of each adjacent block at top, bottom, left, and right sides of the block, Inverse Discrete Cosine Transform (IDCT) is performed on the restored DCT coefficients to restore pixel values.
In the technology disclosed in Patent Reference 1 described above, DCT coefficients of each block previously stored in a memory such as RAM are referred to in order to restore pixel values of one block when compressed image data is decompressed. Here, it is necessary to refer not only to DCT coefficients of the block to be processed but also to DCT coefficients of adjacent blocks at the top, bottom, left, and right sides of the block. This causes a problem in that the number of times the memory is accessed per block is great, thereby increasing the time required to perform the decompression process.